require 'vector'

describe Vector, "angle calculations from provided point vector" do
  before(:each) do
    @v = Vector.new
  end
  
  it "should return an angle of 0 for point [0, 0]" do
    @v.point = Point.new(0, 0)
    @v.angle.should == 0
  end
  
  it "should return an angle of 0 for point [0, 1]" do
    @v.point = Point.new(0, 1)
    @v.angle.should == 0
  end
  
  it "should return an angle of 45 for point [1, 1]" do
    @v.point = Point.new(1, 1)
    @v.angle.should == 45
  end
  
  it "should return an angle of 90 for point [1,0]" do
    @v.point = Point.new(1, 0)
    @v.angle.should == 90
  end
  
  it "should return an angle of 135 for point [1, -1]" do
    @v.point = Point.new(1, -1)
    @v.angle.should == 135
  end
  
  it "should return an angle of 180 for point [0, -1]" do
    @v.point = Point.new(0, -1)
    @v.angle.should == 180
  end
  
  it "should return an angle of 225 for point [-1, -1]" do
    @v.point = Point.new(-1, -1)
    @v.angle.should == 225
  end
  
  it "should return an angle of 270 for point [-1, 0]" do
    @v.point = Point.new(-1, 0)
    @v.angle.should == 270
  end
  
  it "should return an angle of 315 for point [-1, 1]" do
    @v.point = Point.new(-1, 1)
    @v.angle.should == 315
  end
  
  it "should return an angle of 53 for point [3, 4]" do
    @v.point = Point.new(3, 4)
    @v.angle.should == 53
  end
end